package com.ruoyi.ysg.service.impl;

import com.ruoyi.ysg.domain.YsgIncomeStatistic;
import com.ruoyi.ysg.domain.YsgStatistic;
import com.ruoyi.ysg.domain.YsgStudentStatistic;
import com.ruoyi.ysg.domain.YsgTeacherStatistic;
import com.ruoyi.ysg.domain.YsgOrderStatistic;
import com.ruoyi.ysg.mapper.YsgStatisticMapper;
import com.ruoyi.ysg.service.IYsgStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class YsgStatisticServiceImpl implements IYsgStatisticService {
    @Autowired
    private YsgStatisticMapper ysgStatisticMapper;

    @Override
    public YsgStatistic getYsgStatistic(YsgStatistic ysgStatistic) {
        List<YsgTeacherStatistic> teacherStatistic = ysgStatisticMapper.getTeacherStatistic(ysgStatistic);
        List<YsgStudentStatistic> studentStatistic = ysgStatisticMapper.getStudentStatistic(ysgStatistic);
        List<YsgOrderStatistic> orderStatistic = ysgStatisticMapper.getOrderStatistic(ysgStatistic);
        List<YsgIncomeStatistic> incomeStatistic = ysgStatisticMapper.getIncomeStatistic(ysgStatistic);
        ysgStatistic.setTeacherStatisticList(teacherStatistic);
        ysgStatistic.setStudentStatisticList(studentStatistic);
        ysgStatistic.setOrderStatisticList(orderStatistic);
        ysgStatistic.setIncomeStatisticList(incomeStatistic);
        return ysgStatistic;
    }
}
